package ModelLayer;
import java.util.ArrayList;

/**
 * Class for objects of CompositeProduct
 * 
 * @author (AF, RA, KP, RL) 
 * @version (2012.06.05)
 */
public class CompositeProduct extends Product
{
    private ArrayList<Partlist> partlists;

    /**
     * Constructor for objects of class CompositeProduct
     * 
     * @param productName name of Product as String 
     * @param productDescription description of Product as String
     * @param barcode barcode of Product as int
     * @param price price of Product as double
     * @param retailPrice retailPrice of Product as double
     * @param quantity quantity of Product as int
     */
    public CompositeProduct(String productName, String productDescription, int barcode, double price, 
                               double retailPrice, int quantity)
    {
        super(productName, productDescription, barcode, price, retailPrice, quantity);
        partlists = new ArrayList<Partlist>();
    }
    
    /**
     * adds PartList to CompositeProduct instance
     * 
     * @param partlist partlist as Partlist 
     * 
     * @return none
     */
    public void addPartlist(Partlist partlist) 
    {
        partlists.add(partlist);
    }
    
    /**
     * lists all PartLists in CompositeProduct instance
     * 
     * @param none
     * 
     * @return partlists as ArrayList
     */
    public ArrayList<Partlist> getChildren() 
    {
        return partlists;
    }
    
}